<?php
  require_once('../includes.php');
  $membership = New Membership();
  $membership->confirm_admin();
  $time_table = Agenda::les_table();

  include('../header.php');
?>

<div id='login'>
<div class="block">
  <h2 class="red">Lestijden</h2>
  <div id="info">
    <?php echo Website::create_link("admin/","Administratie", "right"); ?>
    
    <form action="action.php" method="post">
      <h3>Nieuwe lestijd toevoegen</h3>
      <em>Bijv. 9:00 of 18:30</em>

      <ul>
        <li>
          <label for='vanaf'>Vanaf</label>
          <input type='text' name='vanaf'>
        </li>
      </ul>

      <input type='hidden' name='action' value='add'>
      <input type='submit' id='submitButton' value='Toevoegen'>
    </form>

    <table>
      <tr class='red'>
        <th class='single'>Lestijd</th>
        <th></th>
        <th></th>
      </tr>

      <?php foreach($time_table as $time) : ?>

      <tr class="<?php echo ($count++ % 2 == 1) ? 'odd' : 'even' ?>">
        <td class='single'><?php echo $time->tijd; ?></td>
        <td class='short'><?php echo Website::create_link("tijden/edit.php?t=".$time->tijd."&id=".$time->ID, "Aanpassen", "edit"); ?></td>
        <td class='short'><?php echo Website::create_link("tijden/delete.php?t=".$time->tijd."&id=".$time->ID, "Verwijderen", "delete"); ?></td>
      </tr>

      <?php endforeach; ?>

    </table>
  </div>
</div>
</div>
<?php include('../footer.php'); ?>